<?php
require_once("checkLogin.inc.php");

if(isset($_GET["a"])) {
	getInfo();
}

function getInfo() {

	$con = mysql_connect("kebo.be", "deb46832_php", "WvWX44Y6") or die(mysql_error());
	mysql_select_db("deb46832_update", $con) or die(mysql_error());
		
	$result = mysql_query("SELECT * FROM `newUpdate`") or die(mysql_error());
	$fetch = mysql_fetch_array($result);
	
	//create new dom document
	$doc = new DomDocument('1.0');
	$root = $doc->createElement("results");
	$doc->appendChild($root);
	
	$v = $doc->createElement("version");
	$v->appendChild($doc->createTextNode($fetch["version"]));
	$root->appendChild($v);

	$d = $doc->createElement("description");
	$d->appendChild($doc->createTextNode($fetch["description"]));
	$root->appendChild($d);

	echo $doc->saveXML();
}
?>